Skip to content

feat(database-client): add db.sql tagged template - #191

Merged
jamie-at-bunny merged 2 commits into
mainfrom
feat/database-client-sql-template
Aug 25, 2026
Merged

feat(database-client): add db.sql tagged template#191
jamie-at-bunny merged 2 commits into
mainfrom
feat/database-client-sql-template

Conversation

@jamie-at-bunny

Copy link
Copy Markdown
Member

No description provided.

@bunnynet-devops

Copy link
Copy Markdown

@codex review

@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f6b1ba

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@bunny.net/database-client Patch
@bunny.net/database-adapter Patch
@bunny.net/database-shell Patch
@bunny.net/database-studio Patch
@bunny.net/database-shell-linux-x64 Patch
@bunny.net/database-shell-linux-arm64 Patch
@bunny.net/database-shell-darwin-x64 Patch
@bunny.net/database-shell-darwin-arm64 Patch
@bunny.net/database-shell-windows-x64 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds a parameterized db.sql tagged-template API to the database client.

  • Converts every interpolation into a positional ? placeholder and encodes its value using existing binding rules.
  • Rejects interpolated objects rather than interpreting them as named parameters.
  • Adds execution and binding tests, user documentation, and a patch changeset.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or compatibility issues identified.

The tagged template preserves interpolation order, routes values through the established encoder, constructs a normal Statement with positional arguments, and is covered across construction and execution paths.

Important Files Changed

Filename Overview
packages/database-client/src/client.ts Adds the public Database.sql tagged-template method using positional placeholders and existing value encoding.
packages/database-client/src/client.test.ts Covers placeholder generation, templates without interpolations, object rejection, and statement execution.
packages/database-client/README.md Documents parameterization, return behavior, supported binding semantics, and identifier limitations.
.changeset/database-client-sql-template.md Records the database-client API addition as a patch release.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  T[Tagged SQL template] --> J[Join literal segments with ?]
  V[Interpolated values] --> E[encodeValue]
  J --> S[Statement]
  E --> A[Positional arguments]
  A --> S
  S --> X[Existing statement execution API]
Loading

Reviews (1): Last reviewed commit: "update changeset" | Re-trigger Greptile

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 2f6b1ba9c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jamie-at-bunny
jamie-at-bunny merged commit 63f1037 into main Aug 25, 2026
5 checks passed
@jamie-at-bunny
jamie-at-bunny deleted the feat/database-client-sql-template branch August 25, 2026 18:53
@github-actions github-actions Bot mentioned this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants